package com.rd.student.ruanjian.class4.baiyunyao.DAY0728;

import com.rd.teacher.jichao.day16.MyRunnable;
import jdk.nashorn.internal.parser.Scanner;


import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;


public class xianchengchi {
    private static final int CODE_POOL_SIZE = 1;
    private static final int MAX_POOL_SIZE = 1;
    private static final int QUEUE_CAPACITY = 2;
    private static final long KEEP_ALIVE_TIME = 1L;

    public static void main(String[] args) {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(
                CODE_POOL_SIZE, MAX_POOL_SIZE,
                KEEP_ALIVE_TIME, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(QUEUE_CAPACITY),
                new ThreadPoolExecutor.AbortPolicy());
        MyRunnable magicsGO = new MyRunnable();
    }

}
class xianchengchi2 {
    private static Integer integer;
    private static final int CODE_POOL_SIZE = integer.MAX_VALUE;
    private static final int MAX_POOL_SIZE = integer.MAX_VALUE;
    private static final int QUEUE_CAPACITY = 1;
    private static final long KEEP_ALIVE_TIME = 1L;

    public static void main(String[] args) {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(
                CODE_POOL_SIZE, MAX_POOL_SIZE,
                KEEP_ALIVE_TIME, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(QUEUE_CAPACITY),
                new ThreadPoolExecutor.AbortPolicy());
        MyRunnable magicsGO = new MyRunnable();
    }

}
class xianchengchi3 {
    private static Integer integer;
    private static final int CODE_POOL_SIZE = integer.MAX_VALUE;
    private static final int MAX_POOL_SIZE = integer.MAX_VALUE;
    private static final int QUEUE_CAPACITY = 1;
    private static final long KEEP_ALIVE_TIME = 1L;

    public static void main(String[] args) {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(
                CODE_POOL_SIZE, MAX_POOL_SIZE,
                KEEP_ALIVE_TIME, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(QUEUE_CAPACITY),
                new ThreadPoolExecutor.AbortPolicy());
        System.out.println("请输入想要的线程数");
        //int magicGO = new Scanner (System.in);/
        int magicGO=0;
        int num = magicGO;
       for (int i = 0; i<num;){
        MyRunnable magicsGO = new MyRunnable();
    }

}
}